package com.wangzhixuan.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.wangzhixuan.model.Wages_apply;
import com.wangzhixuan.service.DaoRuService;
import com.wangzhixuan.service.InsertPersonService;





@Controller  
@RequestMapping("/daoru")  
public class DaoRuController{  
      
	@Autowired  
    private DaoRuService  daoRuService;   
      
	@RequestMapping(value="/upload",method=RequestMethod.POST)
    @ResponseBody  
    public String  upload(@RequestParam(value="file",required = false)MultipartFile file,HttpServletRequest request, HttpServletResponse response){  
        String result = daoRuService.readExcelFile(file);
        
        return result;  
    }
	
	@Autowired  
    private InsertPersonService  insertPersonService;   
    
	@RequestMapping(value="/insertPerson",method=RequestMethod.POST)
    @ResponseBody  
    public String  insertPerson(Wages_apply wages_apply){  
        String result = insertPersonService.insertPerson(wages_apply);
        return result;
  }
	
	
}  
